<?php
	//
	function preg_replace_r($pattern, $replace, $haystack){
		foreach ($pattern as $v) {
			if(is_array($v)){
				preg_replace_r($pattern, $replace, $v);
			}else{
				return preg_replace($pattern, $replace, $v);
			}
		}
	}
	//
?>